feat(query-bar): Filter chip component: validation, keyboard interactions, and overflow behavior [AS-638]#37
Closed
pigarevaoks wants to merge 21 commits intomainfrom
Closed
Conversation
Contributor
|
This PR is included in version 0.10.0-rc-feature-filter-attacks-components-oks.1 |
Contributor
|
This PR is included in version 0.10.0-rc-feature-filter-attacks-components-oks.2 |
Complete implementation of the QueryBar component for building filter expressions: - Progressive chip building flow: field → operator → value - Inline segment editing (click attribute/operator/value to edit in-place) - Multi-select value editing with dropdown checkboxes - AND/OR logical connectors between conditions - Date field support with calendar picker and range selection - Keyboard navigation (ArrowUp/Down, Enter, Escape, ArrowRight, Cmd+Arrow multi-select) - Fuzzy sort for field and value dropdown menus - Insertion gaps for adding conditions between existing chips - Error validation for unknown fields and invalid values - Comprehensive E2E and unit tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…av and chip editing - Remove duplicate WithFooter story in DropdownMenu - Improve keyboard navigation in QueryBar menus - Fix chip editing flow and value menu state handling - Update QueryBar e2e tests - Clean up index exports Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rator menu - Update OPERATOR_LABELS_BY_TYPE for all field types (string, integer, float, date) - Add operator symbol Kbd badges to operator menu items (hidden for boolean) - Support custom operators list from FieldMetadata via operators prop - Set operator menu width to 256px per Figma spec Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Support `options: string[]` on FieldMetadata as shorthand for simple values and `options: []` for freeform custom value input. Space key also commits freeform values (same as Enter). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ning and menu flow - Enforce single-dropdown constraint: connector chip and autocomplete menu cannot be open simultaneously - Decompose useQueryBarAutocomplete into focused sub-hooks: useFocusManagement, useInputHandlers, valueCommitHelpers - Fix dropdown Y-axis and X-axis positioning when inserting between chips - Use flushSync for menu repositioning on gap clicks and chip completion - Add continueBuilding parameter to resetState to prevent unwanted menu opens - Fix deriveAutocompleteValues to use getFieldValues instead of raw values - Memoize operatorGroups, extract constants, simplify value commit logic - Add building chip wrapper with border styling and inline input Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract buildContainerAnchoredRect utility and useQueryBarPositioning hook to unify dropdown positioning across ConnectorChip and autocomplete menus. Both now anchor vertically to the query bar container edge. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Highlight errors on specific chip segments (attribute or value) instead
of the whole chip. For multi-value chips, only invalid values are red.
- Add ChipErrorSegment discriminated type ('attribute' | 'value' | boolean)
- Extract ValueSegment component for multi-value per-value error coloring
- Use CVA compoundVariants to avoid Tailwind class conflicts
- Extract shared isValidFieldValue/getInvalidValueIndices helpers
- Pass valueParts array to avoid fragile comma-split on display strings
- Fix connector chip open state flash during menu transitions
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Display a destructive Alert under the QueryBar input listing all filter validation errors (unknown fields, invalid values). - Add QueryBarErrors component using Alert compound components - Add parseQueryBarErrors pure function for error message generation - Reuse isValidFieldValue/getFieldValues shared helpers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… blur Separate display text from dropdown filter text so editing a chip segment shows all options until the user types. Add blurCommitRef pattern so clicking outside a multi-select dropdown commits checked values instead of discarding them. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Collapse chip area to 3 visible rows with overflow scroll - Add Expand (Maximize2) / Collapse (Minimize2) buttons with tooltips - Auto-collapse when chips are removed and content fits - Position action buttons absolutely so chips span full width - Add thin native scrollbar styled to match ScrollArea thumb color - Extract useExpandCollapse hook and decompose height constants Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… to folders - Extract resetSegmentState, removeConnectorAtConditionIndex, findMatchingFieldValue, getEditingCondition helpers to reduce duplication - Extract CONNECTOR_ID_PATTERN, QUERY_BAR_SELECTOR into shared lib/constants - Extract useChipsSplitting hook from QueryBarInput - Move hooks into dedicated hooks/ directories (QueryBarInput, QueryBarMenu) - Remove single quotes from error messages in parseQueryBarErrors - Add clarifying comment for flushSync close→reopen pattern Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix useConsistentBuiltinInstantiation: Array() → new Array() - Add missing dateRange dependency in useQueryBarAutocomplete resetState - Add biome-ignore for intentional dependency omissions in Segment, QueryBarDateValueMenu, useValueMenuState, useKeyboardNav Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace biome-ignore suppressions with proper fixes: - Segment: use children/editText as fallback values - DateValueMenu: remove showCalendar read, simplify else - useValueMenuState: stabilize commitChecked with useCallback, use ref guard for serialized comparison - useKeyboardNav: add handleModArrow and menuRef to deps - QueryBar stories: add w-[800px] decorator Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
a4d016b to
9d64329
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change error parameter type from boolean to ChipErrorSegment to match the actual signature in useQueryBarExpression. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Kbdbadges and type-specific labels to the operator menu (e.g. string: "is", "like"; date: "after", "on or after")options: string[]shorthand onFieldMetadatafor simple value listsoptions: []for freeform custom value input (no dropdown, Space/Enter commits)Test plan
Kbdsymbol badges appear for all types except booleanoptions: ['GET', 'POST', ...]renders value dropdown correctlyoptions: [](freeform) skips value dropdown, Enter/Space creates chippnpm --filter design-system exec tsc --noEmit— no errorspnpm --filter design-system test— all tests pass🤖 Generated with Claude Code